package main

import (
	"fmt"
)

type Foo struct {
	foo string
}

func (f Foo) VShow() {
	fmt.Println(f.foo)
}

func (pf *Foo) PShow() {
	fmt.Println(pf.foo)
}

type VShower interface{
    VShow()
}

func main() {
	var foo = Foo{"bar1"}
    // value of `foo` is copied and the address of that copy is stored in `ifooo`
    // NOT the case that the address of `foo` is stored in `ifoo`
    // To store address of `foo` directly in `ifoo`, use `var ifoo VShow = &foo`
	var ifoo VShower = foo
	foo.VShow()
	foo.PShow()
    ifoo.VShow()    //show the value in the copy

    foo.foo = "bar2"    //original value changed
	foo.VShow()
	foo.PShow()
    ifoo.VShow()        //value in the copy stays the same
}
